我正在尝试通过composer安装Yii2:
composer global require "fxp/composer-asset-plugin:~1.1.1" composer create-project --prefer-dist yiisoft/yii2-app-basic basic
〜/ .composer/composer.json
{ "require": { "fxp/composer-asset-plugin": "~1.1.1" } }
结果:
Problem 1 - yiisoft/yii2 2.0.x-dev requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 dev-master requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.5 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - Installation request for yiisoft/yii2 >=2.0.5 -> satisfiable by yiisoft/yii2[2.0.5, 2.0.6, dev-master, 2.0.x-dev].
我做错了什么?
rm -rf ~/.composer/vendor rm ~/.composer/composer.lock cd ~/.composer composer clear-cache composer self-update composer global require "fxp/composer-asset-plugin:^1.1.3" composer install
然后转到您的工作目录并运行:
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
您可以尝试更新的版本:
composer global require "fxp/composer-asset-plugin:^1.2.0"
然后:
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
您可以从存档文件下载安装 Yii2 .通过这种方式,您将不需要处理Bower问题.
此外,如果您需要在不处理鲍尔更新作曲家,您可以要求yidas/yii2作曲家鲍尔跳过之前yiisoft/yii2
在composer.json
文件中:
"require": { "php": ">=5.4.0", "yidas/yii2-composer-bower-skip": "~2.0.0", "yiisoft/yii2": "~2.0.5", "yiisoft/yii2-bootstrap": "~2.0.0" }
相反,如果您想创建没有bower-asset问题的yii2项目:
yidas/yii2-app-basic:
composer create-project yidas/yii2-app-basic
yidas/yii2-app-advanced:
composer create-project yidas/yii2-app-advanced
从Yii 2.0.13开始,它使用Asset-Packagist解决方案而不是
fxp/composer-asset-plugin